<?php

use Illuminate\Database\Seeder;
use App\User;

class UserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        User::truncate();


        $user = User::create([
            'username' => 'yuan1998',
            'name' => 'bibi',
            // 'email' => 'chizhiyueshu@gmail.com',
            'phone' => '18888888888',
            'password' => bcrypt('3322123aa'),
        ]);
        $user->syncRoles('admin');
        $user = User::create([
            'username' => 'admin',
            'name' => 'admin',
            // 'email' => 'chizhiyueshu@gmail.com',
            'phone' => '18877777777',
            'password' => bcrypt('3322123aa'),
        ]);
        $user->syncRoles('admin');


        for ($i = 0; $i < 10; $i++) {
            $user = User::create([
                'username' => "zx_public$i",
                'name' => "zx$i",
                'phone' => "1334444$i$i$i$i",
                'password' => bcrypt('3322123aa'),
            ]);
            $user->syncRoles('user:zx');

            $user = User::create([
                'username' => "kq_public$i",
                'name' => "kq$i",
                'phone' => "1335555$i$i$i$i",
                'password' => bcrypt('3322123aa'),
            ]);
            $user->syncRoles('user:kq');
        }



    }
}
